#include "stdafx.h"
#include "TestSpec.h"
#include "Spec.h"

CPPUNIT_TEST_SUITE_REGISTRATION( TestSpec );

using namespace PDMS::PDMSFrame;

TestSpec::TestSpec()
{
}


TestSpec::~TestSpec()
{
}

void TestSpec::TestClone()
{
	UeDbObject* pSpec = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spec) );
	CPPUNIT_ASSERT( pSpec );
	CPPUNIT_ASSERT( pSpec->Clone() );

}

void TestSpec::TestIsLegalParent()
{
	UeDbObject* pSpec = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spec) );
	UeDbObject* pObj = PDMSClassRegister::Instance()
		->CreateObject( UE_PDMSCLASS_REGKEY(Spwl) );
	CPPUNIT_ASSERT( pSpec );
	CPPUNIT_ASSERT( pObj);
	CPPUNIT_ASSERT( !pSpec->IsLegalParent( pSpec ) );
	CPPUNIT_ASSERT( pSpec->IsLegalParent( pObj ) );
}	